
<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>FindBLAS &mdash; CMake 3.27.4 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />
    
    <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
    <script src="../_static/jquery.js"></script>
    <script src="../_static/underscore.js"></script>
    <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
    <script src="../_static/doctools.js"></script>
    <script src="../_static/sphinx_highlight.js"></script>
    
    <link rel="shortcut icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="FindBoost" href="FindBoost.html" />
    <link rel="prev" title="FindBISON" href="FindBISON.html" />
 

  </head><body>

    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="FindBoost.html" title="FindBoost"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="FindBISON.html" title="FindBISON"
             accesskey="P">previous</a> |</li>
  <li>
    <img src="../_static/cmake-logo-16.png" alt=""
         style="vertical-align: middle; margin-top: -2px" />
  </li>
  <li>
    <a href="https://cmake.org/">CMake</a> &#187;
  </li>
  <li>
    <a href="../index.html">3.27.4 Documentation</a> &#187;
  </li>

          <li class="nav-item nav-item-1"><a href="../manual/cmake-modules.7.html" accesskey="U">cmake-modules(7)</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">FindBLAS</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="findblas">
<span id="module:FindBLAS"></span><h1>FindBLAS<a class="headerlink" href="#findblas" title="Permalink to this heading">¶</a></h1>
<p>Find Basic Linear Algebra Subprograms (BLAS) library</p>
<p>This module finds an installed Fortran library that implements the
<a class="reference external" href="https://netlib.org/blas/">BLAS linear-algebra interface</a>.</p>
<p>At least one of the <code class="docutils literal notranslate"><span class="pre">C</span></code>, <code class="docutils literal notranslate"><span class="pre">CXX</span></code>, or <code class="docutils literal notranslate"><span class="pre">Fortran</span></code> languages must be enabled.</p>
<section id="input-variables">
<h2>Input Variables<a class="headerlink" href="#input-variables" title="Permalink to this heading">¶</a></h2>
<p>The following variables may be set to influence this module's behavior:</p>
<dl>
<dt><code class="docutils literal notranslate"><span class="pre">BLA_STATIC</span></code></dt><dd><p>if <code class="docutils literal notranslate"><span class="pre">ON</span></code> use static linkage</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">BLA_VENDOR</span></code></dt><dd><p>Set to one of the <a class="reference internal" href="#blas-lapack-vendors"><span class="std std-ref">BLAS/LAPACK Vendors</span></a> to search for BLAS only
from the specified vendor.  If not set, all vendors are considered.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">BLA_F95</span></code></dt><dd><p>if <code class="docutils literal notranslate"><span class="pre">ON</span></code> tries to find the BLAS95 interfaces</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">BLA_PREFER_PKGCONFIG</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.11.</span></p>
</div>
<p>if set <code class="docutils literal notranslate"><span class="pre">pkg-config</span></code> will be used to search for a BLAS library first
and if one is found that is preferred</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">BLA_PKGCONFIG_BLAS</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.25.</span></p>
</div>
<p>If set, the <code class="docutils literal notranslate"><span class="pre">pkg-config</span></code> method will look for this module name instead of
just <code class="docutils literal notranslate"><span class="pre">blas</span></code>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">BLA_SIZEOF_INTEGER</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.22.</span></p>
</div>
<p>Specify the BLAS/LAPACK library integer size:</p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">4</span></code></dt><dd><p>Search for a BLAS/LAPACK with 32-bit integer interfaces.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">8</span></code></dt><dd><p>Search for a BLAS/LAPACK with 64-bit integer interfaces.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">ANY</span></code></dt><dd><p>Search for any BLAS/LAPACK.
Most likely, a BLAS/LAPACK with 32-bit integer interfaces will be found.</p>
</dd>
</dl>
</dd>
</dl>
</section>
<section id="imported-targets">
<h2>Imported targets<a class="headerlink" href="#imported-targets" title="Permalink to this heading">¶</a></h2>
<p>This module defines the following <span class="target" id="index-0-prop_tgt:IMPORTED"></span><a class="reference internal" href="../prop_tgt/IMPORTED.html#prop_tgt:IMPORTED" title="IMPORTED"><code class="xref cmake cmake-prop_tgt docutils literal notranslate"><span class="pre">IMPORTED</span></code></a> targets:</p>
<dl>
<dt><code class="docutils literal notranslate"><span class="pre">BLAS::BLAS</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.18.</span></p>
</div>
<p>The libraries to use for BLAS, if found.</p>
</dd>
</dl>
</section>
<section id="result-variables">
<h2>Result Variables<a class="headerlink" href="#result-variables" title="Permalink to this heading">¶</a></h2>
<p>This module defines the following variables:</p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">BLAS_FOUND</span></code></dt><dd><p>library implementing the BLAS interface is found</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">BLAS_LINKER_FLAGS</span></code></dt><dd><p>uncached list of required linker flags (excluding <code class="docutils literal notranslate"><span class="pre">-l</span></code> and <code class="docutils literal notranslate"><span class="pre">-L</span></code>).</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">BLAS_LIBRARIES</span></code></dt><dd><p>uncached list of libraries (using full path name) to link against
to use BLAS (may be empty if compiler implicitly links BLAS)</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">BLAS95_LIBRARIES</span></code></dt><dd><p>uncached list of libraries (using full path name) to link against
to use BLAS95 interface</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">BLAS95_FOUND</span></code></dt><dd><p>library implementing the BLAS95 interface is found</p>
</dd>
</dl>
</section>
<section id="blas-lapack-vendors">
<span id="id1"></span><h2>BLAS/LAPACK Vendors<a class="headerlink" href="#blas-lapack-vendors" title="Permalink to this heading">¶</a></h2>
<dl>
<dt><code class="docutils literal notranslate"><span class="pre">Generic</span></code></dt><dd><p>Generic reference implementation</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">ACML</span></code>, <code class="docutils literal notranslate"><span class="pre">ACML_MP</span></code>, <code class="docutils literal notranslate"><span class="pre">ACML_GPU</span></code></dt><dd><p>AMD Core Math Library</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">AOCL</span></code>, <code class="docutils literal notranslate"><span class="pre">AOCL_mt</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.27.</span></p>
</div>
<p>AMD Optimizing CPU Libraries</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">Apple</span></code>, <code class="docutils literal notranslate"><span class="pre">NAS</span></code></dt><dd><p>Apple BLAS (Accelerate), and Apple NAS (vecLib)</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">Arm</span></code>, <code class="docutils literal notranslate"><span class="pre">Arm_mp</span></code>, <code class="docutils literal notranslate"><span class="pre">Arm_ilp64</span></code>, <code class="docutils literal notranslate"><span class="pre">Arm_ilp64_mp</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.18.</span></p>
</div>
<p>Arm Performance Libraries</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">ATLAS</span></code></dt><dd><p>Automatically Tuned Linear Algebra Software</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">CXML</span></code>, <code class="docutils literal notranslate"><span class="pre">DXML</span></code></dt><dd><p>Compaq/Digital Extended Math Library</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">EML</span></code>, <code class="docutils literal notranslate"><span class="pre">EML_mt</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.20.</span></p>
</div>
<p>Elbrus Math Library</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">FLAME</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.11.</span></p>
</div>
<p>BLIS Framework</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">FlexiBLAS</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.19.</span></p>
</div>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">Fujitsu_SSL2</span></code>, <code class="docutils literal notranslate"><span class="pre">Fujitsu_SSL2BLAMP</span></code>, <code class="docutils literal notranslate"><span class="pre">Fujitsu_SSL2SVE</span></code>, <code class="docutils literal notranslate"><span class="pre">Fujitsu_SSL2BLAMPSVE</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.20.</span></p>
</div>
<p>Fujitsu SSL2 serial and parallel blas/lapack with SVE instructions</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">Goto</span></code></dt><dd><p>GotoBLAS</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">IBMESSL</span></code>, <code class="docutils literal notranslate"><span class="pre">IBMESSL_SMP</span></code></p>
<blockquote>
<div><p>IBM Engineering and Scientific Subroutine Library</p>
</div></blockquote>
<dl>
<dt><code class="docutils literal notranslate"><span class="pre">Intel</span></code></dt><dd><p>Intel MKL 32 bit and 64 bit obsolete versions</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">Intel10_32</span></code></dt><dd><p>Intel MKL v10 32 bit, threaded code</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">Intel10_64lp</span></code></dt><dd><p>Intel MKL v10+ 64 bit, threaded code, lp64 model</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">Intel10_64lp_seq</span></code></dt><dd><p>Intel MKL v10+ 64 bit, sequential code, lp64 model</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">Intel10_64ilp</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.13.</span></p>
</div>
<p>Intel MKL v10+ 64 bit, threaded code, ilp64 model</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">Intel10_64ilp_seq</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.13.</span></p>
</div>
<p>Intel MKL v10+ 64 bit, sequential code, ilp64 model</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">Intel10_64_dyn</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.17.</span></p>
</div>
<p>Intel MKL v10+ 64 bit, single dynamic library</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">NVHPC</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.21.</span></p>
</div>
<p>NVIDIA HPC SDK</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">OpenBLAS</span></code></dt><dd><div class="versionadded">
<p><span class="versionmodified added">New in version 3.6.</span></p>
</div>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">PhiPACK</span></code></dt><dd><p>Portable High Performance ANSI C (PHiPAC)</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">SCSL</span></code>, <code class="docutils literal notranslate"><span class="pre">SCSL_mp</span></code></dt><dd><p>Scientific Computing Software Library</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">SGIMATH</span></code></dt><dd><p>SGI Scientific Mathematical Library</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">SunPerf</span></code></dt><dd><p>Sun Performance Library</p>
</dd>
</dl>
</section>
<section id="intel-mkl">
<span id="id2"></span><h2>Intel MKL<a class="headerlink" href="#intel-mkl" title="Permalink to this heading">¶</a></h2>
<p>To use the Intel MKL implementation of BLAS, a project must enable at least
one of the <code class="docutils literal notranslate"><span class="pre">C</span></code> or <code class="docutils literal notranslate"><span class="pre">CXX</span></code> languages.  Set <code class="docutils literal notranslate"><span class="pre">BLA_VENDOR</span></code> to an Intel MKL
variant either on the command-line as <code class="docutils literal notranslate"><span class="pre">-DBLA_VENDOR=Intel10_64lp</span></code> or in
project code:</p>
<div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">set(</span><span class="no">BLA_VENDOR</span><span class="w"> </span><span class="nb">Intel10_64lp</span><span class="nf">)</span>
<span class="nf">find_package(</span><span class="no">BLAS</span><span class="nf">)</span>
</pre></div>
</div>
<p>In order to build a project using Intel MKL, and end user must first
establish an Intel MKL environment:</p>
<dl>
<dt>Intel oneAPI</dt><dd><p>Source the full Intel environment script:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>.<span class="w"> </span>/opt/intel/oneapi/setvars.sh
</pre></div>
</div>
<p>Or, source the MKL component environment script:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>.<span class="w"> </span>/opt/intel/oneapi/mkl/latest/env/vars.sh
</pre></div>
</div>
</dd>
<dt>Intel Classic</dt><dd><p>Source the full Intel environment script:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>.<span class="w"> </span>/opt/intel/bin/compilervars.sh<span class="w"> </span>intel64
</pre></div>
</div>
<p>Or, source the MKL component environment script:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>.<span class="w"> </span>/opt/intel/mkl/bin/mklvars.sh<span class="w"> </span>intel64
</pre></div>
</div>
</dd>
</dl>
<p>The above environment scripts set the <code class="docutils literal notranslate"><span class="pre">MKLROOT</span></code> environment variable
to the top of the MKL installation.  They also add the location of the
runtime libraries to the dynamic library loader environment variable for
your platform (e.g. <code class="docutils literal notranslate"><span class="pre">LD_LIBRARY_PATH</span></code>).  This is necessary for programs
linked against MKL to run.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>As of Intel oneAPI 2021.2, loading only the MKL component does not
make all of its dependencies available.  In particular, the <code class="docutils literal notranslate"><span class="pre">iomp5</span></code>
library must be available separately, or provided by also loading
the compiler component environment:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>.<span class="w"> </span>/opt/intel/oneapi/compiler/latest/env/vars.sh
</pre></div>
</div>
</div>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <div>
    <h3><a href="../index.html">Table of Contents</a></h3>
    <ul>
<li><a class="reference internal" href="#">FindBLAS</a><ul>
<li><a class="reference internal" href="#input-variables">Input Variables</a></li>
<li><a class="reference internal" href="#imported-targets">Imported targets</a></li>
<li><a class="reference internal" href="#result-variables">Result Variables</a></li>
<li><a class="reference internal" href="#blas-lapack-vendors">BLAS/LAPACK Vendors</a></li>
<li><a class="reference internal" href="#intel-mkl">Intel MKL</a></li>
</ul>
</li>
</ul>

  </div>
  <div>
    <h4>Previous topic</h4>
    <p class="topless"><a href="FindBISON.html"
                          title="previous chapter">FindBISON</a></p>
  </div>
  <div>
    <h4>Next topic</h4>
    <p class="topless"><a href="FindBoost.html"
                          title="next chapter">FindBoost</a></p>
  </div>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/module/FindBLAS.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="FindBoost.html" title="FindBoost"
             >next</a> |</li>
        <li class="right" >
          <a href="FindBISON.html" title="FindBISON"
             >previous</a> |</li>
  <li>
    <img src="../_static/cmake-logo-16.png" alt=""
         style="vertical-align: middle; margin-top: -2px" />
  </li>
  <li>
    <a href="https://cmake.org/">CMake</a> &#187;
  </li>
  <li>
    <a href="../index.html">3.27.4 Documentation</a> &#187;
  </li>

          <li class="nav-item nav-item-1"><a href="../manual/cmake-modules.7.html" >cmake-modules(7)</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">FindBLAS</a></li> 
      </ul>
    </div>

    <div class="footer" role="contentinfo">
        &#169; Copyright 2000-2023 Kitware, Inc. and Contributors.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.3.0.
    </div>
  </body>
</html>